package org.scirp.ijmis.service.personpaper.impl;

import java.util.List;

import org.scirp.ijmis.dao.personpaper.IPublicationDAO;
import org.scirp.ijmis.po.personpaper.Publication;
import org.scirp.ijmis.service.personpaper.IPublicationService;

public class PublicationServiceImpl implements IPublicationService {

	private static final String className = PublicationServiceImpl.class.toString();
	private IPublicationDAO publicationDAO;

	public List<Publication> selectAll() {
		return publicationDAO.selectAll();
	}

	public Long countObject() {
		return publicationDAO.countObject();
	}

	public Publication selectById(Object id) {

		return publicationDAO.selectById(id);
	}

	public long savePublication(Publication entity) {
		return publicationDAO.savePublication(entity);
	}

	public boolean updatePublication(Publication entity) {
		return publicationDAO.updatePublication(entity);
	}

	public boolean deletePublicationByPublicationId(Long publicationId) {
		return publicationDAO.deletePublicationByPublicationId(publicationId);
	}

	public Publication selectPublicationByPaperId(Long paperId) {
		return publicationDAO.selectPublicationByPaperId(paperId);

	}

	public List<Publication> selectByJournalId(Long journalId) {
		return publicationDAO.selectByJournalId(journalId);
	}

	public List<Publication> selectPublication(String volume, String number, String month, String year, Long journalId, Long pid) {
		return publicationDAO.selectPublication(volume, number, month, year, journalId, pid);
	}

	public boolean selectPublicationIsExist(String volume, String number, String month, String year, Long journalId, Long pid) {
		List<Publication> list = publicationDAO.selectPublication(volume, number, month, year, journalId, pid);
		if (list != null) {
			if (list.size() > 0) {
				return true;
			}
		}
		return false;
	}

	public IPublicationDAO getPublicationDAO() {
		return publicationDAO;
	}

	public void setPublicationDAO(IPublicationDAO publicationDAO) {
		this.publicationDAO = publicationDAO;
	}
}
